using System;
using System.Collections.Generic;
using System.Text;

namespace TTDotNet.Util
{
    public class RotateCoords
    {
        private Coordinate[,] rotateCoords;

        public RotateCoords()
        {
            rotateCoords = new Coordinate[4, 4];
            setupRotateCoords();
        }

        public Coordinate get(int rotType, int vertNum)
        {
            return rotateCoords[rotType, vertNum];
        }


        private void setupRotateCoords()
        {
            Coordinate zz = new Coordinate(0, 0);
            Coordinate oz = new Coordinate(1, 0);
            Coordinate zo = new Coordinate(0, 1);
            Coordinate oo = new Coordinate(1, 1);

            // No rotation
            rotateCoords[0, 0] = zz; rotateCoords[0, 1] = oz;
            rotateCoords[0, 2] = zo; rotateCoords[0, 3] = oo;

            //90 Degree Rotation
            rotateCoords[1, 0] = zo; rotateCoords[1, 1] = zz;
            rotateCoords[1, 2] = oo; rotateCoords[1, 3] = oz;

            //180 Degree Rotation
            rotateCoords[2, 0] = oo; rotateCoords[2, 1] = zo;
            rotateCoords[2, 2] = oz; rotateCoords[2, 3] = zz;

            //270 Degree Rotation
            rotateCoords[3, 0] = oz; rotateCoords[3, 1] = oo;
            rotateCoords[3, 2] = zz; rotateCoords[3, 3] = zo;
        }

    }
}
